import request from '@/http/request'
// 获取实物奖品列表

export const $getGoodsList = (params:any) => {
    return request.request({
      url: '/api/award/goods',
      method: 'get',
      params: params
    })
  }

//   更改实物奖品状态
export const $goodsState = (data:any) => {
    return request.request({
      url: '/api/award/goods/state',
      method: 'put',
      data: data
    })
  }
// 删除实物奖品
export function $goodsDelete(goodsId:any) {
    return request.request({
      url: '/api/award/goods',
      method: 'DELETE',
      params: { goodsId }
    })
  }

//   请求实物奖品详情
export const $goodsDetail = (params:any) => {
    return request.request({
      url: '/api/award/goods/details',
      method: 'get',
      params: params
    })
  }

//   新建实物奖品or修改
export function $goodsAddOrEdit(method:any,data:any) {
    return request.request({
      url: '/api/award/goods',
      method:method,
      data:data,
    })
  }
/* 机构列表 */
export function $queryOrgTree(agentNo:any) {
    return request.request({
      url: '/api/subList/queryOrgTree',
      method: 'get',
      params: {agentNo}
    })
  }

  // 新增奖品分配给机构 新增(POST) 修改(PUT) 删除(DELETE)
  export function $activityAwardAgentAddOrEdit(method:any,data:any) {
    return request.request({
      url: '/api/activity/award/agent',
      method,
      data,
    })
  }

